package com.atguigu.client;

import com.atguigu.entity.*;
import com.atguigu.result.RetVal;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;
@FeignClient(value = "shop-product")//,fallback = ProductFallback.class)
public interface ProductFeignClient {
    //1.根据商品skuId查询商品基本信息
    @GetMapping("/sku/getSkuInfo/{skuId}")
    public SkuInfo getSkuInfo(@PathVariable Long skuId);
    //2.根据三级分类id获取商品的分类信息
    @GetMapping("/sku/getCategoryView/{category3Id}")
    public BaseCategoryView getCategoryView(@PathVariable Long category3Id);
    //3.根据skuId获取商品的实时价格
    @GetMapping("/sku/getSkuPrice/{skuId}")
    public BigDecimal getSkuPrice(@PathVariable Long skuId);
    //4.获取该sku所有的spu销售属性(很多)与sku的销售属性(一个)
    @GetMapping("/sku/getSpuSaleProperteyAndSelected/{productId}/{skuId}")
    public List<ProductSalePropertyKey> getSpuSaleProperteyAndSelected(@PathVariable Long productId, @PathVariable Long skuId);
    //5.查询销售属性组合与skuid的一个对应关系
    @GetMapping("/sku/getSalePropertyAndSkuIdMapping/{productId}")
    public Map<Object, Object> getSalePropertyAndSkuIdMapping(@PathVariable Long productId);
    //4.查询首页分类信息
    @GetMapping("/product/getIndexCategory")
    public RetVal getIndexCategory();

    //8.根据品牌id查询品牌信息
    @GetMapping("/product/brand/getBrandById/{brandId}")
    public BaseBrand getBrandById(@PathVariable Long brandId);

    //9.根据skuId查询平台属性信息
    @GetMapping("/product/getPlatformPropertyBySkuId/{skuId}")
    public List<PlatformPropertyKey> getPlatformPropertyBySkuId(@PathVariable Long skuId);
}
